﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Microsoft.Security.Application;

using IdeaNMR.Web.Core;
using IdeaNMR.Shared;

namespace IdeaNMR.Web
{
    public partial class DesignSpectrometer : DesignHardObject_BasePage<Spectrometer>
    {
        protected override string PageTitle
        {
            get
            {
                return this.Master.Title;
            }
            set
            {
                this.Master.Title = value;
            }
        }
        protected override void SetValidationParameters()
        {
            base.SetValidationParameters();

            tbFrequency.MaxLength = Sanitar.Frequency.MaxLength;
            rfvFrequency.Text = revFrequency.Text = Sanitar.Frequency.ErrorMsg;
            revFrequency.ValidationExpression = Sanitar.Frequency.ValidationRegex;
        }

        protected override void CollectFormData()
        {
            base.CollectFormData();

            this.HardObjectInfo.EntityObject.Frequency = double.Parse(this.tbFrequency.Text);
        }
        protected override void UpdateFormData()
        {
            base.UpdateFormData();

            this.tbFrequency.Text = this.HardObjectInfo.EntityObject.Frequency.ToString("#.##");
        }
    }
}